<template>
  <div class="title" @click="change">
    <slot name="title"></slot>
    <span :class="['iconfont', show ? 'icon-up' : 'icon-down']"></span>
  </div>
  <div class="content" v-show="show">
    <slot></slot>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

//默认不展示
const show = ref(false)
const change = () => {
  show.value = !show.value
}
</script>

<style lang="less" scoped>
.title {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f1f2f3;
  border-radius: 5px;
  height: 44px;
  padding: 0 20px;
}
</style>
